package com.qf.simple_queue;/*
 *保护你的大熊
 *2021/12/18
 *10:14
 */

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "simple_queue")
public class SimpleListener {

    /**
     *
     * @param msg 队列中的数据
     */
    @RabbitHandler
    public void onMessage(String msg){
        System.out.println("消息队列中的数据：" + msg);
    }

}
